﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class BagItem : MonoBehaviour
{
    public GameObject redDotObj;
    public Text countText;
    private BagData data;

    public void SetData(BagData data)
    {
        this.data = data;
        countText.text = "x" + data.count;
        redDotObj.SetActive(data.isRead==false);
    }

    public void OnButtonClick()
    {
        if (this.data.isRead==false)
        {
            this.data.isRead = true;
            redDotObj.SetActive(false);
            ZM.RedDotSystem.RedDotSystem.Instance.UpdateRedDotState(ZM.RedDotSystem.RedDotDefine.BagRoot);
        }
    }
}
